package com.hmall.api.user.fallback;

import com.hmall.api.user.UserClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author: wqy
 * @Date: 2025/09/04 16:28
 * @Description:
 */
@Slf4j
@Component
public class UserClientFallbackFactory implements FallbackFactory<UserClient> {
    @Override
    public UserClient create(Throwable cause) {
        return new UserClient() {

            @Override
            public void deductMoney(String pw, Integer totalFee) {
                log.error("远程调用UserClient#deductMoney方法出现异常{}", cause.getMessage());
            }
        };
    }
}
